<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      const arr1 = ["a", "b", "c", "d", "e", "f"];

      // 复制数组，循环复制，在过程中过滤掉不符合要求的元素
      function revArr(arr) {
        let r = [];
        for (let i = arr.length - 1; i >= 0; i--) {
          r.push(arr[i]);
        }
        return r;
      }
      console.log(revArr(arr1));
    </script>
  </body>
</html>
